import MainScene from "@/pages/MainPage/MainScene.tsx";
import {createStyles} from "antd-style";
import MainContent from "@/pages/MainPage/MainContent.tsx";
import {useNavigate} from "react-router-dom";
import UserLoginModal from "@/components/UserLoginModal.tsx";
import React, {useState} from "react";

const useStyles = createStyles(({css, token}) => {
    return {
        container: css`
            display: flex;
            background-color: transparent;
        `,
    }
})

const MainPage = () => {
    const styles = useStyles().styles;
    const navigate = useNavigate();

    const [openLoginModal, setOpenLoginModal] = useState(false)
    const triggerLogin = () => {
        setOpenLoginModal(true)
    }

    const triggerEnter = () => {
        navigate("/context")
    }

    return (
        <div className={styles.container}>
            <MainContent triggerLogin={triggerLogin} triggerEnter={triggerEnter}/>
            <MainScene/>
            <UserLoginModal open={openLoginModal} setOpen={setOpenLoginModal}/>
        </div>
    )
}

export default MainPage